﻿using System;
using System.Linq;
using Windows.UI.Xaml.Data;

namespace BouncingBallGame.Helpers
{
    public class MetersToDpiConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            if (value is double && parameter is double)
            {
                return (double)value * (double)parameter;
            }

            return null;
        }

        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            if (value is double && parameter is double)
            {
                return (double)value / (double)parameter;
            }

            return null;
        }
    }
}
